package com.xiacherensheng.demo.basejava.classinfo;

public class ClassInfo {
    public ClassInfo() {

    }

    public static void main(String[] args) {
        ClassInfo object = new ClassInfo();
        try {
            Class class1 = object.getClass();
            Class class2 = ClassInfo.class;
            Class class3 = Class.forName("com.xiacherensheng.demo.basejava.classinfo.ClassInfo");

            System.out.println(class1 == class2);
            System.out.println(class2 == class3);
            System.out.println(class1 == class3);

            CustomClassLoader customClassLoader = new CustomClassLoader("d:/project");
            Class t1 = customClassLoader.loadClass("com.xiacherensheng.demo.basejava.classinfo.ClassInfo");

            System.out.println(t1 == class1);
            CustomClassLoader2 customClassLoader2 = new CustomClassLoader2("d:/project");
            Class t2 = customClassLoader2.loadClass("com.xiacherensheng.demo.basejava.classinfo.ClassInfo");
            System.out.println(t1 == t2);
        } catch (Exception e) {
            e.printStackTrace();
        }

    }
}

//    CustomClassLoader customClassLoader = new CustomClassLoader("d:/project");
//    Class t1 = customClassLoader.loadClass("com.xiacherensheng.demo.basejava.classinfo.ClassInfo");
//
//    CustomClassLoader2 customClassLoader1 = new CustomClassLoader2("d:/project");
//    Class t2 = customClassLoader1.loadClass("com.xiacherensheng.demo.basejava.classinfo.ClassInfo");
//            System.out.println(t1 == t2);


